package com.smart.sso.server.util;

import java.util.HashMap;
import java.util.Map;

import org.apache.activemq.management.SizeStatisticImpl;

public class OperationUtils {
	
	private static Map<Integer , String> operationMap = new HashMap();
	
	public final static int operation_login = 11;
	public final static int operation_logout= 12;
	public final static int operation_changePassword = 21;
	
	public final static int operation_user_add = 22;
	public final static int operation_user_edit = 23;
	public final static int operation_user_disable = 24;
	public final static int operation_user_enable = 25;
	public final static int operation_user_delete = 26;
	public final static int operation_user_resetPassword = 27;
	
	public final static int operation_role_add = 31;
	public final static int operation_role_edit = 32;
	public final static int operation_role_disable = 33;
	public final static int operation_role_enable = 34;
	public final static int operation_role_delete = 35;
	public final static int operation_role_authorize = 36;
	public final static int operation_role_app_authorize = 37;
	
	public final static int operation_app_add = 41;
	public final static int operation_app_edit = 42;
	public final static int operation_app_disable = 43;
	public final static int operation_app_enable = 44;
	public final static int operation_app_delete = 45;
	
	public final static int operation_permission_add = 51;
	public final static int operation_permission_edit = 52;
	public final static int operation_permission_delete = 53;
	public final static int operation_permission_log = 54;
	
	public final static int operation_user_audit_accept = 61;
	public final static int operation_user_audit_refuse = 62;
	
	public final static int operation_group_add = 63;
	public final static int operation_group_delete =64 ;
	public final static int operation_group_edit = 65;
	
	public final static int operation_groupmemeber_add = 66;
	public final static int operation_groupmember_delete = 67;
	
	public final static int operation_node_add = 68;
	public final static int operation_node_delete = 69;
	public final static int operation_node_change = 70;
	public final static int operation_node_reset = 71;
	public final static int operation_synchronize_database = 72;
	
	static {
		operationMap.put(operation_login, "登陆系统");
		operationMap.put(operation_logout, "退出系统");
		operationMap.put(operation_changePassword, "修改密码");
		
		operationMap.put(operation_user_add, "添加用户");
		operationMap.put(operation_user_edit, "修改用户信息");
		operationMap.put(operation_user_disable, "禁用用户");
		operationMap.put(operation_user_enable, "启用用户");
		operationMap.put(operation_user_delete, "删除用户");
		operationMap.put(operation_user_resetPassword, "重置用户密码");
		
		operationMap.put(operation_role_add, "添加角色");
		operationMap.put(operation_role_edit, "修改角色");
		operationMap.put(operation_role_disable, "禁用角色");
		operationMap.put(operation_role_enable, "启用角色");
		operationMap.put(operation_role_delete, "删除角色");
		operationMap.put(operation_role_authorize, "授权角色");
		operationMap.put(operation_role_app_authorize, "角色应用授权");
		
		operationMap.put(operation_app_add, "添加应用");
		operationMap.put(operation_app_edit, "修改应用");
		operationMap.put(operation_app_disable, "禁用应用");
		operationMap.put(operation_app_enable, "启用应用");
		operationMap.put(operation_app_delete, "删除应用");
		
		operationMap.put(operation_permission_add, "添加权限");
		operationMap.put(operation_permission_edit, "修改权限");
		operationMap.put(operation_permission_delete, "删除权限");
		operationMap.put(operation_permission_log, "日志授权");
		
		operationMap.put(operation_user_audit_accept, "通过用户注册申请");
		operationMap.put(operation_user_audit_refuse, "拒绝用户注册申请");
		
		operationMap.put(operation_group_add, "新增组群");
		operationMap.put(operation_group_delete, "删除组群");
		operationMap.put(operation_group_edit, "编辑组群");
		
		operationMap.put(operation_groupmemeber_add, "添加组员");
		operationMap.put(operation_groupmember_delete, "删除组员");
		
		operationMap.put(operation_node_add, "新增节点");
		operationMap.put(operation_node_delete, "删除节点");
		operationMap.put(operation_node_change, "切换节点");
		operationMap.put(operation_node_reset, "返回主节点");
		operationMap.put(operation_synchronize_database, "同步数据库");
	}
	
	public String getOperationDescription(int id) {
		return operationMap.get(id);
	}
	
}
